package com.garyliang.alihot;

import android.Manifest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.taobao.sophix.SophixManager;
import com.tbruyelle.rxpermissions2.RxPermissions;

import io.reactivex.functions.Consumer;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        RxPermissions rxPermissions = new RxPermissions(this);
        rxPermissions
                .request(Manifest.permission.READ_EXTERNAL_STORAGE,
                        Manifest.permission.READ_PHONE_STATE,
                        Manifest.permission.ACCESS_NETWORK_STATE,
                        Manifest.permission.ACCESS_WIFI_STATE)
                .subscribe(new Consumer<Boolean>() {
                    @Override
                    public void accept(Boolean aBoolean) throws Exception {
                        if (aBoolean) {
                            Log.e("xx","All requested permissions are granted");
                            // All requested permissions are granted
                        } else {
                            Log.e("xx","At least one permission is denied");
                            // At least one permission is denied
                        }
                    }
                });




        Toast.makeText(this,"正常测试修复版本",Toast.LENGTH_SHORT).show();
//       int[] indexs=new int[]{1,3,4,5};
//        Log.e("xx","indexs[5] "+indexs[5]);
//        findViewById(R.id.user_tv).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Toast.makeText(MainActivity.this,"我是修复的版本",Toast.LENGTH_SHORT).show();
//            }
//        });
    }
}
